<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div{
            position: absolute;
            width: 200px;
            height: 200px;
        }
        .box1{
            position: absolute;
            z-index: 2;

            /* top: 100px;
            left: 100px; */
            
            background-color: pink;
        }
        .box2{
            position: absolute;
            z-index: 1;

            top: 150px;
            left: 150px;
            background-color: red;
        }
    </style>

</head>
<body>
    <div class="box1">1</div>
    <div class="box2">2</div>
</body>
</html>